package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SwapFaceTaskMapper;
import com.ruoyi.system.domain.SwapFaceTask;
import com.ruoyi.system.service.ISwapFaceTaskService;
import com.ruoyi.common.core.text.Convert;

/**
 * 换脸任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-25
 */
@Service
public class SwapFaceTaskServiceImpl implements ISwapFaceTaskService 
{
    @Autowired
    private SwapFaceTaskMapper swapFaceTaskMapper;

    /**
     * 查询换脸任务
     * 
     * @param id 换脸任务主键
     * @return 换脸任务
     */
    @Override
    public SwapFaceTask selectSwapFaceTaskById(Long id)
    {
        return swapFaceTaskMapper.selectSwapFaceTaskById(id);
    }

    /**
     * 查询换脸任务列表
     * 
     * @param swapFaceTask 换脸任务
     * @return 换脸任务
     */
    @Override
    public List<SwapFaceTask> selectSwapFaceTaskList(SwapFaceTask swapFaceTask)
    {
        return swapFaceTaskMapper.selectSwapFaceTaskList(swapFaceTask);
    }

    /**
     * 新增换脸任务
     * 
     * @param swapFaceTask 换脸任务
     * @return 结果
     */
    @Override
    public int insertSwapFaceTask(SwapFaceTask swapFaceTask)
    {
        swapFaceTask.setCreateTime(DateUtils.getNowDate());
        return swapFaceTaskMapper.insertSwapFaceTask(swapFaceTask);
    }

    /**
     * 修改换脸任务
     * 
     * @param swapFaceTask 换脸任务
     * @return 结果
     */
    @Override
    public int updateSwapFaceTask(SwapFaceTask swapFaceTask)
    {
        swapFaceTask.setUpdateTime(DateUtils.getNowDate());
        return swapFaceTaskMapper.updateSwapFaceTask(swapFaceTask);
    }

    /**
     * 批量删除换脸任务
     * 
     * @param ids 需要删除的换脸任务主键
     * @return 结果
     */
    @Override
    public int deleteSwapFaceTaskByIds(String ids)
    {
        return swapFaceTaskMapper.deleteSwapFaceTaskByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除换脸任务信息
     * 
     * @param id 换脸任务主键
     * @return 结果
     */
    @Override
    public int deleteSwapFaceTaskById(Long id)
    {
        return swapFaceTaskMapper.deleteSwapFaceTaskById(id);
    }
}
